Skip to content

Conversation

@fatelei
Copy link
Contributor

@fatelei fatelei commented Dec 25, 2025

@adriancaruana
Copy link

This PR doesn't actually fix the race condition; it makes the race window smaller but doesn't eliminate it. The retry adds extra syscalls in the error path with no clear benefit since it doesn't eliminate the race. The same failure mode can still occur:

  • Retry mkdir() -> raises FileExistsError (another thread created it)
  • Check is_dir() -> returns False (that thread deleted it again)
  • Incorrectly raises FileExistsError for non-existent path

@fatelei fatelei closed this Dec 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants